package validateServlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import javax.servlet.*;
public class validate extends HttpServlet {
	
	RequestDispatcher rd;
	
	public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException
	{
		String name,Address,phone,State;
		name=request.getParameter("nameText");
		Address=request.getParameter("addressText");
		phone=request.getParameter("telText");
		State=request.getParameter("stateSelect");
		
		if(name=="" ||Address==""||phone==""||State=="")
		{
			response.sendRedirect("/TestForm/homePage.jsp");
			
		}
		else
		{
			rd=getServletContext().getRequestDispatcher("/TestForm/abc.html");
			rd.forward(request, response);
		}
		
	}
}